#ifndef __HERM_PRIVATE_BITMAP_H__
#define __HERM_PRIVATE_BITMAP_H__

namespace herm{
namespace Private{

class Bitmap
{	
    typedef unsigned int Ty;	// base type for a storage word
public:
    Bitmap();
    void Init(size_t size);
    bool Set(size_t pos);
    bool Reset(size_t pos);
    bool Test(size_t pos) const;
private:
    enum
    {	// parameters for packing bits into words
        Bitsperword = (int)(8 * sizeof (Ty)),	// bits in each word
        //  m_words = (int)(m_size == 0 ? 0 : (m_size - 1) / Bitsperword)
    };	// NB: number of words - 1

    void Tidy(Ty val = 0);
    void Trim();
private:
    Ty* m_bits;	
    size_t m_size;
    int m_words;
};
}
}

#endif
